package com.reload.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Date: 2024/12/7 - 17:08
 * @Version: 17
 * @Author: Reloading
 * @Description: 全局异常处理器
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(AbstractMethodError.class)
    public String error(AbstractMethodError error){
        System.out.println("数学运算异常");
        return "炸了，哈哈哈....";
    }
}
